package com.yan.demo.demo3;

/**
 * @author taoge
 * @Date 2024/8/8 14:59
 * @Description
 */
public class MyTask1 implements Runnable{
    private  Stack stack;

    public MyTask1(Stack stack) {
        this.stack = stack;
    }

    @Override
    public void run() {
        int i = 0;
        while (true) {
            if(i % 2 == 0){
                stack.create("包子" , "白色的");
            }else{
                stack.create("馒头" , "黄色的");
            }
            i++;
        }
    }
}
